1. Field of the Invention
The present invention relates to interrupt processing in a computer system. More particularly, the present invention relates to interrupt dispatching.
2. Art Background
In a computer system, an interrupt is an exception that is signaled to the processor by a hardware device. Devices use interrupts to notify the processor of a change in the device's condition, such as the initiation or completion of an I/O request. Many devices can initiate interrupts, including third party devices connected through expansion slots provided in the computer system. A variety of devices can be coupled to the computer system, including disk drives, audio cards, video cards and the like. In addition, multiple devices have been configured on a card that fits into a single expansion slot.
An interrupt causes the processor to suspend normal execution, save the current execution state and execute an interrupt service routine also referred to as an interrupt handler. Upon completion of the interrupt service routine, the state prior to the execution of the interrupt service routine is restored and the processor resumes normal execution.
It is not uncommon that multiple interrupt signals are issued concurrently. Each device is assigned to have a priority level, thereby enabling the processor to use the priority levels of the devices to determine the order the interrupts are serviced.
Each device has an associated device driver. The device driver is code executed by the processor to interface with the device. The device driver includes the interrupt handler for the device.
The information received by the processor upon issuance of an interrupt is minimal. For example, an interrupt may simply be a signal that transitions from an inactive state to an active state to indicate that an interrupt request has been issued. Some systems include multiple interrupt lines such that the line the interrupt signal is driven on indicates some limited information regarding the interrupt. Generally, however, the processor responds to an interrupt request by first determining the device that issued the interrupt. This process of determining the interrupting device is referred to as interrupt dispatching. To determine the interrupting device, the processor will activate device drivers containing subroutines which when executed reads certain registers, flags or memory locations on the computer system to determine if the driver's corresponding device issued the interrupt. The interrupt dispatching process is closely tied to the computer system hardware configuration as the process often requires examination of registers and memory not located on the device that issued the interrupt. The hardware examined can vary from device to device, making it impossible for the processor to determine without accessing the device driver code for each device. In addition, the device drivers will typically contain code regarding the priority of the device.
However, if all or a portion of the hardware changes, the interrupt dispatching mechanism changes. This often dictates that the device drivers be modified to operate with the changed hardware. For example, if the device is connected to a different hardware platform, the device driver will have to be manually modified as to the steps performed, e.g., the examination of specific registers, will most likely be changed. If a new type of device is connected to an existing hardware platform with existing devices, and the new device alters the priority of the interrupts, the device drivers of the existing devices will have to be modified to comply with the change in priority.
Bus bridges introduce additional issues. For example, in a computer system that follows the Peripheral Connector Interchange (PCI) standard, one slot may be allocated to a bridge which connects to a second PCI bus to connect additional devices. However, a bridge typically communicates minimal information that an interrupt request has been issued by a device. No information is typically conveyed as to which device issued an interrupt or if multiple interrupts were issued. Therefore, the device drivers of each device coupled through the bridge would have to be polled or interrogated to determine the device(s) that issued an interrupt.